package com.jfirer.validator.validation;

import javax.validation.MessageInterpolator.Context;
import javax.validation.metadata.ConstraintDescriptor;

public class MessageContextImpl implements Context
{
    private final Object                  validatedValue;
    private final ConstraintDescriptor<?> constraintDescriptor;
    
    public MessageContextImpl(Object validatedValue, ConstraintDescriptor<?> constraintDescriptor)
    {
        this.validatedValue = validatedValue;
        this.constraintDescriptor = constraintDescriptor;
    }
    
    @Override
    public ConstraintDescriptor<?> getConstraintDescriptor()
    {
        return constraintDescriptor;
    }
    
    @Override
    public Object getValidatedValue()
    {
        return validatedValue;
    }
    
    @Override
    public <T> T unwrap(Class<T> type)
    {
        throw new UnsupportedOperationException();
    }
    
}
